package com.ty.day4;

import java.util.Scanner;

/**
 * Created by IntelliJ IDEA.
 *
 * @author : txy
 * @create : 2023/11/9 11:42
 */
public class Three {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入单价和数量：");
        double price, number, sum = 0;
        while (true) {
            price = sc.nextDouble();
            number = sc.nextDouble();
            sum += number * price;
            if (price==-1){
                break;
            }
        }
        if (sum > 600) {
            sum = sum * 0.7;
            System.out.print("给你7折，");
        } else if (sum > 400) {
            sum *= 0.8;
            System.out.print("给你8折，");
        } else if (sum > 200) {
            sum *= 0.9;
            System.out.print("给你9折，");
        }
        System.out.println("需付款" + sum);

    }
}
